//
// Created by ailoc on 2023/10/21.
//

#include "rulebook.h"

auto RuleBook::addRule(std::string current_state, char current_char, char overwrite_char, mvd direction,
                       std::string next_state) -> RuleBook* {
    ruleBook[std::make_pair(current_state,current_char)] = OptAction {overwrite_char,direction,next_state};

    return this;
}

const std::map<std::pair<std::string, char>, OptAction> &RuleBook::getRuleBook() const {
    return ruleBook;
}

const std::set<std::string> &RuleBook::getFinalStateSet() const {
    return final_stateSet;
}

void RuleBook::setStartState(const std::string &startState) {
    start_state = startState;
}

void RuleBook::setFinalStateSet(const std::set<std::string> &finalStateSet) {
    final_stateSet = finalStateSet;
}

const std::string &RuleBook::getStartState() const {
    return start_state;
}
